<?
require("config.php");

$location_status .= "| Add";

$show_backnav = "brand_menu";

$menuname = NULL;

$menutarget = NULL;

if (NULL!=$action){

   $table = "pro_brand";

   $field = array(
	"code", 
	"name", 
	"logo1", 
	"logo2",
	);


   $content = array(
	$Code,
	$Name,
	$Logo1_name,
	$Logo2_name,
	);

   myInsert($table,$field,$content);

	$dir = "pro_brand/";

	myUpload($Logo1,$Logo1_name,$dir);

	myUpload($Logo2,$Logo2_name,$dir);


   header("location:" . $rela_path . "share/msg.php?v=4");

}else{

  if (checkCode("pro_brand",$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9001");
  
  }

}

require($rela_path . "inc/header.php");

?>

<table width="95%" border="0" align="center">
  <tr> 
    <td align="right">&nbsp; </td>
  </tr>
  <tr> 
    <td> <form action="<?echo $PHP_SELF?>" method="post" enctype="multipart/form-data" name="form1">
        <table border="0" cellspacing="1" cellpadding="1">
          <tr> 
            <td class="tdheader">Code : </td>
            <td><?print($Code)?>
              <input name="action" type="hidden" value="add">
			  <input name="Code" type="hidden" value="<?print($Code)?>"></td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td class="tdheader">Name :</td>
            <td><input name="Name" type="text" class="text" id="Name" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Logo 1 :</td>
            <td><input name="Logo1" type="File" class="text" id="Logo1" size="40"> 
            </td>
          </tr>
          <tr> 
            <td class="tdheader">Logo 2 : </td>
            <td><input name="Logo2" type="File" class="text" id="Logo2" size="40"> 
            </td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td><input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('brand_menu.php',1);;return false;"> 
            <input type="image" src="../../images/bt_save.gif"> 
            </td>
          </tr>
        </table>
      </form>
      <p> <br>
        <br>
        <br>
        <br>
        <br>
        <br>
      </p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp; </p></td>
  </tr>
</table>
<?
require($rela_path . "inc/footer.php");
?>
